package object;

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author: admin
 * @Description:
 * @Date: 2019/6/14 11:07
 */

public class UserInfo {
    private byte[] data = new byte[1024 * 1024];
    private String userName;
    private Integer age;

    public byte[] getData() {
        return data;
    }

    public String getUserName() {
        return userName;
    }

    public Integer getAge() {
        return age;
    }

    public UserInfo() {

    }

    public UserInfo(String userName, Integer age) {
        this.userName = userName;
        this.age = age;
    }


    public static void main(String[] args) throws InterruptedException {
//        Size[] size=new Size[100];

//        Long[] longs =new Long[1000];
//        for (int i=0; i<30;i++){
//            System.out.println(i);
//            Thread.sleep(1000);
//        }
//       longs[0]=1L;
//        Long[] longs1 =new Long[1000];
//        longs1[0]=1L;

//        UserInfo userInfo=new UserInfo();
//        A a=new A();
//        while (true){
//            System.out.println("---");
//        }


        List<UserInfo> userInfoList = Arrays.asList(
                new UserInfo("A", 1),
                new UserInfo("B", 3),
                new UserInfo("C", 2));

        userInfoList.forEach(userInfo -> System.out.println(userInfo.userName));
        System.out.println("--------");
        userInfoList.stream().sorted(Comparator.comparing(UserInfo::getAge)).collect(Collectors.toList());
        System.out.println("--------");
        userInfoList.forEach(userInfo -> System.out.println(userInfo.userName));


    }

}
